<template>
  <page-header-wrapper :title="false">
    <a-card title="浏览日志">
      <s-table
        bordered
        ref="table"
        :row-key="(record) => record.id"
        :columns="logColumns"
        :data="logData"
      >
        <template slot="index" slot-scope="text,record,index">
          {{ index + 1 }}
        </template>
        <template slot="playtime" slot-scope="text">
          <a-tag color="red">{{ text }}</a-tag>
        </template>
      </s-table>
    </a-card>
  </page-header-wrapper>
</template>

<script>
import { STable } from '@/components'
import col from '@/columns/video'
import { videoRecord } from '@/api/video'

export default {
  components: {
    STable
  },
  name: 'VideoLog',
  data () {
    return {
      logColumns: col.log,
      logData: parameters => {
        return videoRecord(Object.assign(parameters, this.queryParam)).then(res => {
          return res.result
        })
      },
      queryParam: {}
    }
  }
}
</script>

<style scoped>

</style>
